﻿using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;

namespace GenesisOne
{
    static class Physic
    {
        static public void Jump(Character character)
        {
            if (character.Jumpt == 1)
            {
                character.Translation = new Vector2(character.Translation.X, -6);
                character.Jumpt = 2;
            }               
        }

        static public void Gravity(Character character, GraphicsDeviceManager graphics)
        {
            if (character.Position.Y + (character.Texture.Height / 3) < graphics.PreferredBackBufferHeight - 64)
                character.Translation = new Vector2(character.Translation.X, character.Translation.Y + 0.25f);
            if (character.Position.Y + ((character.Texture.Height / 3) - 1) > graphics.PreferredBackBufferHeight - 64)
            {
                character.Translation = new Vector2(character.Translation.X, 0);
                character.Jumpt = 0;
            }
        }

        }
    }
